import type { StoreInfo } from "@/Interface/StoreInfoInterface";
import style from "./style.module.scss";


export default function SpecificInfo({ store }: { store: StoreInfo }) {

  const {
    basicInfo: {
      storeName = '',
      province = '',
      city = '',
      storeType = '',
      areaSize = 0,
      openingDate = '',
      tags: [tag = '无标签'] = ['无标签']
    } = {},
    annualData: {
      avgCustomerValue = 0,
      rating = '',
      reviews: { positive = 0, negative = 0 } = {},
      yearAmount = 0,
      yearGrowth = ''
    } = {}
  } = store || {};


  return (
    <>
      <div className={style.specificInfo}>
        <h3>
          {storeName}
        </h3>
        <ul>
          <li>所在地：{province}-{city}</li>
          <li>年营业额：{(yearAmount / 10000).toFixed(2)}{' 万元'}</li>
          <li>年增长率：{yearGrowth}</li>
          <li>连锁方式：{storeType}</li>
          <li>类型划分：{tag}</li>
          <li>客单价：{avgCustomerValue}{' 元/人'}</li>
          <li>综合评分：{rating}{' 分'}</li>
          <li>评论数：{positive}{' 好评'}&nbsp;&nbsp;{negative}{' 差评'}</li>
          <li>占地面积：{areaSize + ' m³'}</li>
          <li>开业日期：{openingDate}</li>
        </ul>
      </div>
    </>
  )
}